package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution897 {
    public TreeNode increasingBST(TreeNode root) {
        return TreeUtils.increasingBST(root);
    }
}

public class leetcode897 {
    public static void main(String[] args) {
        Solution897 solution897 = new Solution897();
        Integer[] nums = {5,3,6,2,4,null,8,1,null,null,null,7,9};
        test897(solution897, nums);
    }

    private static void test897(Solution897 solution897, Integer[] nums) {
        TreeNode root = solution897.increasingBST(TreeUtils.generateLeetcodeTree(nums));
        System.out.println(TreeUtils.getLeetcodeTreeVals(root));
    }
}
